console.log("进入")
$(".box:eq(0)").append("<div id=\"showPicList\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\"\n" +
    "     aria-labelledby=\"showPicLabel\" aria-hidden=\"true\" style=\"z-index: 1500\">\n" +
    "    <div class=\"modal-dialog\" style=\"width: 540px;\">\n" +
    "        <div class=\"modal-content\">\n" +
    "            <div class=\"modal-header\">\n" +
    "                <button class=\"prev2\">&lt;</button>\n" +
    "                <button class=\"next2\">&gt;</button>\n" +
    "                <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"\n" +
    "                        onclick=\"$('#showPicModal').modal('hide')\">\n" +
    "                    <span aria-hidden=\"true\">&times;</span></button>\n" +
    "                <b class=\"modal-title\" id=\"showPicLabel\"></b>\n" +
    "            </div>\n" +
    "            <div class=\"modal-body\" style=\"position: relative\">\n" +
    "                <div class=\"img-content\"></div>\n" +
    "            </div>\n" +
    "        </div>\n" +
    "    </div>\n" +
    "</div>");


$.showPicModal = function (picList) {
    dex = 0;//图片轮转置0
    picList = picList.split(",");
    var pic = $('.img-content');
    pic.html("").css("top", "0px");
    for (var i in picList) {
        if (picList[i] != "" && picList[i].indexOf("http") < 0)
            pic.append("<img src='http://hldoss.oss-cn-hangzhou.aliyuncs.com/" + picList[i] + "'>")
        else
            pic.append("<img src='" + picList[i] + "'>")
    }
    $(".img-content img[src]:first").show();
    $("#showPicList").modal({
        backdrop: 'static',
        keyboard: false,
        show: true
    })
};


/************图片轮转实现1*************************/
function next() {
    var $picList = $(".pic_list");
    var length = $picList.find("img").length;
    if (dex == length - 1)
        dex = 0;
    else
        dex += 1;
    $picList.css("top", -280 * dex + "px");
}

function prev() {
    var $picList = $(".pic_list");
    var length = $picList.find("img").length;
    if (dex == 0)
        dex = length - 1;
    else
        dex -= 1;
    $picList.css("top", -280 * dex + "px");
}

$(".next").click(_debounce(next, 200));

$(".prev").click(_debounce(prev, 200));

/************图片轮转实现2*************************/
function next2() {
    var $imgList = $(".img-content img[src]");
    $imgList.eq(dex).hide();
    if (dex == $imgList.length - 1)
        dex = 0;
    else dex++;
    $imgList.eq(dex).fadeIn()
}

function prev2() {
    var $imgList = $(".img-content img[src]");
    $imgList.eq(dex).hide();
    if (dex == 0)
        dex = $imgList.length - 1;
    else dex--;
    $imgList.eq(dex).fadeIn()
}

var $next2=_debounce(next2, 200)
var $prev2=_debounce(prev2, 200)

$(".next2").click($next2);

$(".prev2").click($prev2);

